package com.ylyq.ylxx.controller;

import com.ylyq.ylxx.model.ResponseData;
import com.ylyq.ylxx.service.ICoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CoreController
 * @Description TODO
 * @Author xiaweichao
 * @Date 2020/7/21 14:03
 * @Version 1.0
 */
@RestController
@RequestMapping("/core")
@Api(description = "打分表相关接口")
public class CoreController {
    @Autowired
    private ICoreService iCoreService;

    @GetMapping("/refreshCore")
    @ApiOperation(value = "刷新打分表")
    public ResponseData refreshCore() {
        iCoreService.refreshCore();
        return new ResponseData(ResponseData.Result.SUCCESS);
    }

    @GetMapping("/refreshCity")
    @ApiOperation(value = "刷新城市表redis缓存")
    public ResponseData refreshCity() {
        iCoreService.refreshCity();
        return new ResponseData(ResponseData.Result.SUCCESS);
    }

}
